#ifndef CHECKER_H
#define CHECKER_H

#include <QtCore/QObject>
#include <QtCore/QDir>
#include <QtCore/QTimer>
#include <QtCore/QThread>
#include <QtGui/QApplication>
#include "popup.h"
#include "options.h"
#include "client.h"
#include "trayicon.h"

class Checker : public QObject
{
    Q_OBJECT
public:
    Checker(QString email, QString password);
    ~Checker();
    void run();
private:
    void showPopup(QString message, bool force = false);

    QTimer *m_timer;
    QString lastMessage;
    int notShowCount;
    Options *m_options;
    Client *m_client;
    Popup *m_popup;
    TrayIcon *m_trayicon;
public slots:
    void onTimer();
    void reloadSettings();

    void onError(QString message);
    void onCountReceived(int count);

    void trayIconClicked();
    void showOptions();
    void quit();
};

#endif // CHECKER_H
